package com.mukefile.utils;

import java.util.List;

/**
 * @Author: kenewstar
 * @Description: 分页信息
 * @Date:Created in 2020/9/13
 */
public class GetPageInfo<T> {
    /**
     * 页码
     */
    private Integer pageNum;
    /**
     * 每页数据量
     */
    private final Integer pageSize = 5;

    private Integer limitStart;
    private Integer limitEnd;

    public Integer getLimitStart() {
        return limitStart;
    }

    public void setLimitStart(Integer limitStart) {
        this.limitStart = limitStart;
    }

    public Integer getLimitEnd() {
        return limitEnd;
    }

    public void setLimitEnd(Integer limitEnd) {
        this.limitEnd = limitEnd;
    }

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    /**
     * 根据pageNum和pagrSize获取limit分页参数
     * @param pageNum 页码
     * @param pageSize 页面大小
     */
    public void limitPage(int pageNum,int pageSize){
        // limit 开始
        this.limitStart = pageNum*pageSize;
        // limit 结束
        this.limitEnd = pageSize;

    }

}
